package cn.schoolwow.quickdao.module.database.dml.json.service.insert;

import cn.schoolwow.quickdao.module.database.dml.common.flow.CheckReasonInstanceMapFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.common.SetJSONObjectEntityFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.common.filter.FilterJSONArrayByConstraintFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.common.filter.FilterJSONArrayBySameUniqueFieldFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.insert.InsertJSONArrayFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.insert.common.SetInsertJSONObjectStatementFlow;
import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;

public class InsertJSONArrayCompositeBusiness implements CompositeBusinessFlow {
    @Override
    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
        quickFlowExecutor.next(new SetJSONObjectEntityFlow())
                .next(new FilterJSONArrayBySameUniqueFieldFlow())
                .next(new FilterJSONArrayByConstraintFlow())
                .next(new CheckReasonInstanceMapFlow())
                .next(new SetInsertJSONObjectStatementFlow())
                .next(new InsertJSONArrayFlow());
    }

    @Override
    public String name() {
        return "插入JSON数组复合流程";
    }

}
